#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QFile>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    bool copyFile(const QString &fromFIleName, const QString &toFileName);

    void setUrl(QString);

    void setFileName(QString);

public slots:
    void on_finished();
    void on_readyRead();
    void on_downloadProgress(qint64 bytesRead, qint64 totalBytes);
private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void downloadUpdatePack();

    void init();
private:
    Ui::MainWindow *ui;

    QNetworkAccessManager *networkManager;

    QNetworkReply* reply= nullptr;

    QFile * downFile = nullptr;

    QString downloadUrl;

    QString downloadFileName;
};
#endif // MAINWINDOW_H
